package com.bite.springbook.config;

import com.bite.springbook.model.Result;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class ErrorAdvice {
    @ExceptionHandler
    public Result hander(Exception e){
       return Result.fail(e.getMessage());
    }
}
